package Test3;

import java.util.Arrays;

/**
 * 有以下数组：
 * 		int[] arr = {55,77,0,88,22,44,33};
 * 	请编程实现：将后四个数字依次前移一位，移动后，最后一位置为0.
 */

public class Test3 {
    public static void main(String[] args) {
        int[] arr = {55, 77, 0, 88, 22, 44, 33};
        for (int i = 0; i < arr.length - 1; i++) {
            if (arr[i] == 0) {
                int temp = arr[i];
                arr[i] = arr[i + 1];
                arr[i + 1] = temp;
            }
            System.out.println(Arrays.toString(arr));
        }
    }
}
